package com.DesignMode.Singleton;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/10/09/16:46
 * @Description: 直接将对象设置成 private final static 然后方法之间返回这个对象  ----浪费内存
 * @Target: 饿汉式单例
 */
public class HungrySingleton {

    private HungrySingleton() {
    }

    private final static HungrySingleton HUNGRY_SINGLETON = new HungrySingleton();


    public static HungrySingleton getInstance(){
        return HUNGRY_SINGLETON;
    }


}
